<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>

<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>飞车保险</title>
    <link rel="stylesheet" href="static/js/jjs/css/font-awesome.min.css">
    <link rel="stylesheet" href="static/js/jjs/css/bootstrap.min.css">

    <link rel="stylesheet" href="static/js/jjs/css/demo.css" />
    <link rel="stylesheet" href="static/js/jjs/css/templatemo-style.css">

    <script type="text/javascript" src="static/js/jjs/js/modernizr.custom.86080.js"></script>

    <%@include file="/WEB-INF/views/commons/commons.jsp"%>

    <shiro:authenticated>
        <%
            //登录成功之后不需要再登录, 直接跳转到登录成功显示页面
            //可以用于解决shiro只能登录一次的问题
            request.getRequestDispatcher("/index").forward(request, response);
        %>
    </shiro:authenticated>


    <script type="text/javascript" >
        function login() {
            $("#loginForm").form("submit",{
                url:"/login",
                success:function(data) {
                    data=$.parseJSON(data);

                    if(data.success){
                        window.location.href="/index"
                    }else{

                        //登录失败
                        $.messager.alert("温馨提示",data.msg);
                    }
                }
            })
        }
    </script>
</head>

<body>

<div id="particles-js"></div>

<ul class="cb-slideshow">
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
</ul>

<div class="container-fluid">
    <div class="row cb-slideshow-text-container ">
        <div class= "tm-content col-xl-6 col-sm-8 col-xs-8 ml-auto section">
            <header class="mb-5"><h1>叩丁狼科技有限公司</h1></header>
            <P class="mb-5">飞车保险..值得你拥有</P>

            <form  method="post" class="submitForm" id="loginForm">
                <div class="row form-section">
                    <div class="col-md-7 col-sm-7 col-xs-7">
                        <input name="username" type="text" class="form-control" id="contact_username" placeholder="Your Username..." />
                    </div>
                    <br />
                    <br />
                    <div class="col-md-7 col-sm-7 col-xs-7">
                        <input name="password" type="password" class="form-control" id="contact_password" placeholder="Your Password..."/>
                    </div>
                    <div class="col-md-5 col-sm-5 col-xs-5">
                        <button type="button" class="tm-btn-subscribe" onclick="login()">登录</button>
                    </div>

                </div>
            </form>
            <!--
             <div class="tm-social-icons-container text-xs-center">
                 <a href="#" class="tm-social-link"><i class="fa fa-facebook"></i></a>
                 <a href="#" class="tm-social-link"><i class="fa fa-google-plus"></i></a>
                 <a href="#" class="tm-social-link"><i class="fa fa-twitter"></i></a>
                 <a href="#" class="tm-social-link"><i class="fa fa-linkedin"></i></a>
             </div>
                 -->
        </div>
    </div>
    <div class="footer-link">
        <p>Copyright © 2018 Wolf Code

            - Design: <a rel="nofollow" href="#" target="_parent">Templatemo</a></p>
        <p>More Templates <a href="#" target="_blank" title="模板之家">23期</a> - Collect from </p>
    </div>
</div>
</body>

<script type="text/javascript" src="/static/js/jjs/js/app.js"></script>
<script type="text/javascript" src="/static/js/jjs/js/particles.js"></script>
</html>